package org.jivesoftware.smackx.provider;

import java.util.ArrayList;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smackx.RemoteRosterEntry;
import org.jivesoftware.smackx.packet.RosterExchange;
import org.xmlpull.v1.XmlPullParser;

public class RosterExchangeProvider
  implements PacketExtensionProvider
{
  public PacketExtension parseExtension(XmlPullParser paramXmlPullParser)
    throws Exception
  {
    RosterExchange localRosterExchange = new RosterExchange();
    int i = 0;
    RemoteRosterEntry localRemoteRosterEntry = null;
    String str1 = "";
    String str2 = "";
    ArrayList localArrayList = new ArrayList();
    while (i == 0)
    {
      int j = paramXmlPullParser.next();
      if (j == 2)
      {
        if (paramXmlPullParser.getName().equals("item"))
        {
          localArrayList = new ArrayList();
          str1 = paramXmlPullParser.getAttributeValue("", "jid");
          str2 = paramXmlPullParser.getAttributeValue("", "name");
        }
        if (paramXmlPullParser.getName().equals("group"))
          localArrayList.add(paramXmlPullParser.nextText());
      }
      else if (j == 3)
      {
        if (paramXmlPullParser.getName().equals("item"))
        {
          localRemoteRosterEntry = new RemoteRosterEntry(str1, str2, (String[])localArrayList.toArray(new String[localArrayList.size()]));
          localRosterExchange.addRosterEntry(localRemoteRosterEntry);
        }
        if (paramXmlPullParser.getName().equals("x"))
          i = 1;
      }
    }
    return localRosterExchange;
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smackx.provider.RosterExchangeProvider
 * JD-Core Version:    0.6.1
 */